package com.nl.trees;

import com.nl.trees.BTree.Node;

public class TreeMirror {

	public static <T> void mirror(Node<T>root){
		
		if(root==null ||(root.left==null && root.right == null)){
			return;
		}

		Node<T> node = root.left;
		root.left = root.right;
		root.right = node;
		
		if(root.left!=null){
			mirror(root.left);
		}

		if(root.right!=null){
			mirror(root.right);
		}

	}
}
